﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="resultlist.aspx.vb" Inherits="soccer.resultlist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SoccerDataSource">
            <Columns>
                <asp:BoundField DataField="fixtureID" HeaderText="Fixture No." InsertVisible="False" SortExpression="fixtureID" />
                <asp:BoundField DataField="season" HeaderText="Season" SortExpression="season" />
                <asp:BoundField DataField="divisionName" HeaderText="Division" SortExpression="divisionName" />
                <asp:TemplateField HeaderText="Home Team">
                    <ItemTemplate><%# Eval("HomeTeam") %>  <%# Eval("homeTeamScore") %></ItemTemplate>                 
                    <ItemStyle Width="800px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Away Team">
                    <ItemTemplate><%# Eval("AwayTeam")%>  <%# Eval("awayTeamScore")%></ItemTemplate>                 
                    <ItemStyle Width="800px" />
                </asp:TemplateField>
                <asp:BoundField DataField="fixtureDate" HeaderText="Fixture Date" SortExpression="fixtureDate" />
                <asp:ImageField DataImageUrlField="fixturePhoto" HeaderText="Match Photo">
                    <ControlStyle CssClass="fixtureimage" />
                </asp:ImageField>
                <asp:HyperLinkField DataNavigateUrlFields="fixtureID" DataNavigateUrlFormatString="resultdetail.aspx?fixtureId={0}" HeaderText="More Details" Text="Details..." />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SoccerDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SoccerConnectionString %>" ProviderName="<%$ ConnectionStrings:SoccerConnectionString.ProviderName %>" SelectCommand="SELECT Fixture.fixtureID, Fixture.divisionId, Fixture.season, Fixture.hometeamId, Fixture.awayTeamId, Fixture.homeTeamScore, Fixture.awayTeamScore, Fixture.fixtureDate, Fixture.fixturePhoto, Division.divisionName, Team.teamName AS AwayTeam, Team_1.teamName AS HomeTeam FROM (((Fixture INNER JOIN Division ON Fixture.divisionId = Division.DivisionId) INNER JOIN Team ON Fixture.awayTeamId = Team.teamID AND Division.DivisionId = Team.divisionId) INNER JOIN Team Team_1 ON Fixture.hometeamId = Team_1.teamID AND Division.DivisionId = Team_1.divisionId)"></asp:SqlDataSource>
        <br />
    </p>
</asp:Content>
